import urllib2, feedparser


AUTHOR = u"Julio Larrinaga"
APP_NAME = u"Google ato del.icio.us"
VERSION = "0.1"
PROJECT_URL = u"http://code.google.com/p/googlereader-to-delicious/"


class GoogleToDelicious:

	__SOURCE_FEED_TEMPLATE_ = u"http://www.google.com/reader/public/atom/user/%s/state/com.google/starred"
	__DELICIOUS_GET_ = u"https://api.del.icio.us/v1/posts/get?"
	__DELICIOUS_ADD_ = u"https://api.del.icio.us/v1/posts/add?"

	def __init__(self, guid):
		self.guid = guid
		self.source_feed = __SOURCE_FEED_TEMPLATE_ % (guid)
		feedparser.USER_AGENT =  "%s/$s +%s" % (googtodel.APP_NAME, googtodel.VERSION, googtodel.PROJECT_URL)

	def set_uid(self, guid):
		self.uid = guid
		self.source_feed = __SOURCE_FEED_TEMPLATE_ % (guid)

	def get_google_starred():
		
		d = feedparser.parse(self.source_feed)
		for entry in d.entries:
			print entry.title, entry.url

